<template>
  <div>
    <h1>欢迎来到个人中心</h1>
  </div>
</template>

<script setup>
import { useUserStore } from '@/stores/userStore'
import { useCartStore } from '@/stores/cartStore'

const user = useUserStore()
const cart = useCartStore()

function login() {
  user.login('Alice', 25)
}

function logout() {
  user.logout()
}

function addItemToCart() {
  cart.addItem({ id: Date.now(), name: 'Product', price: 10 })
}

function clearCart() {
  cart.clearCart()
}
</script>
